-- GENERATED SPELL FOR [Cabal Warlock] --


function spell0_18640(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_18640', 0, 1)
end

function spell1_18640(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18640', 3000, 1)
end

function spell2_18640(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(15232,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18640', 3000, 1)
end

function Sorts_18640(pUnit, Event)
local choix_sorts_18640 = math.random(0, 2)
if choix_sorts_18640 == 0 then
pUnit:RegisterEvent('spell0_18640', 1, 1)
end
if choix_sorts_18640 == 1 then
pUnit:RegisterEvent('spell1_18640', 1, 1)
end
if choix_sorts_18640 == 2 then
pUnit:RegisterEvent('spell2_18640', 1, 1)
end
end

function mob18640_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18640', math.random(1500, 3000), 1)
end

function mob18640_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18640_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18640_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18640, 1, 'mob18640_Action')
RegisterUnitEvent(18640, 2, 'mob18640_Leave')
RegisterUnitEvent(18640, 3, 'mob18640_Kill')
RegisterUnitEvent(18640, 4, 'mob18640_Die')
